{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 371,
   "id": "27e86681",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from tensorflow.keras.models import Sequential\n",
    "from tensorflow.keras.layers import LSTM\n",
    "from tensorflow.keras.layers import Dense, Dropout\n",
    "import pandas as pd\n",
    "from matplotlib import pyplot as plt\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "import seaborn as sns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 372,
   "id": "59a416cd",
   "metadata": {},
   "outputs": [],
   "source": [
    "df=pd.read_csv(\"train.csv\",parse_dates=[\"Date\"],index_col=[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 373,
   "id": "ab54faea",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "None\n"
     ]
    }
   ],
   "source": [
    "print(df.index.freq)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 374,
   "id": "9d69a828",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(19, 5)"
      ]
     },
     "execution_count": 374,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 375,
   "id": "1fe6f18e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>新增人数</th>\n",
       "      <th>确诊数（自2022年1月8日）</th>\n",
       "      <th>密切接触者人数</th>\n",
       "      <th>正在接受医学观察人数</th>\n",
       "      <th>政府干预</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2022-01-08</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>20763</td>\n",
       "      <td>2588</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-01-09</th>\n",
       "      <td>21</td>\n",
       "      <td>25</td>\n",
       "      <td>21007</td>\n",
       "      <td>2831</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-01-10</th>\n",
       "      <td>10</td>\n",
       "      <td>35</td>\n",
       "      <td>21380</td>\n",
       "      <td>3198</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-01-11</th>\n",
       "      <td>33</td>\n",
       "      <td>68</td>\n",
       "      <td>22675</td>\n",
       "      <td>4493</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-01-12</th>\n",
       "      <td>41</td>\n",
       "      <td>101</td>\n",
       "      <td>23423</td>\n",
       "      <td>5077</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            新增人数  确诊数（自2022年1月8日）  密切接触者人数  正在接受医学观察人数  政府干预\n",
       "Date                                                        \n",
       "2022-01-08     3                3    20763        2588     0\n",
       "2022-01-09    21               25    21007        2831     0\n",
       "2022-01-10    10               35    21380        3198     0\n",
       "2022-01-11    33               68    22675        4493     0\n",
       "2022-01-12    41              101    23423        5077     1"
      ]
     },
     "execution_count": 375,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 376,
   "id": "750dae9a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>新增人数</th>\n",
       "      <th>确诊数（自2022年1月8日）</th>\n",
       "      <th>密切接触者人数</th>\n",
       "      <th>正在接受医学观察人数</th>\n",
       "      <th>政府干预</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2022-01-22</th>\n",
       "      <td>5</td>\n",
       "      <td>359</td>\n",
       "      <td>30291</td>\n",
       "      <td>8952</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-01-23</th>\n",
       "      <td>1</td>\n",
       "      <td>360</td>\n",
       "      <td>30974</td>\n",
       "      <td>8577</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-01-24</th>\n",
       "      <td>1</td>\n",
       "      <td>361</td>\n",
       "      <td>30974</td>\n",
       "      <td>8547</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-01-25</th>\n",
       "      <td>0</td>\n",
       "      <td>361</td>\n",
       "      <td>30980</td>\n",
       "      <td>8150</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2022-01-26</th>\n",
       "      <td>1</td>\n",
       "      <td>362</td>\n",
       "      <td>31002</td>\n",
       "      <td>7757</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            新增人数  确诊数（自2022年1月8日）  密切接触者人数  正在接受医学观察人数  政府干预\n",
       "Date                                                        \n",
       "2022-01-22     5              359    30291        8952     1\n",
       "2022-01-23     1              360    30974        8577     1\n",
       "2022-01-24     1              361    30974        8547     1\n",
       "2022-01-25     0              361    30980        8150     1\n",
       "2022-01-26     1              362    31002        7757     1"
      ]
     },
     "execution_count": 376,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.tail()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 377,
   "id": "9f685196",
   "metadata": {},
   "outputs": [],
   "source": [
    "test_split=round(len(df))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 378,
   "id": "c435d2e4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "19"
      ]
     },
     "execution_count": 378,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 429,
   "id": "6815e6cf",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_for_training=df[:]\n",
    "df_for_testing=df[:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 430,
   "id": "164f3e06",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(19, 5)\n",
      "(19, 5)\n"
     ]
    }
   ],
   "source": [
    "print(df_for_training.shape)\n",
    "print(df_for_testing.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 431,
   "id": "4a86012c",
   "metadata": {},
   "outputs": [],
   "source": [
    "scaler = MinMaxScaler(feature_range=(0,1))\n",
    "df_for_training_scaled = scaler.fit_transform(df_for_training)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 432,
   "id": "5697bff5",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_for_testing_scaled=scaler.transform(df_for_testing)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 433,
   "id": "d33a6b6e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.0375    , 0.        , 0.        , 0.        , 0.        ],\n",
       "       [0.2625    , 0.06128134, 0.02383045, 0.0322153 , 0.        ],\n",
       "       [0.125     , 0.08913649, 0.06025979, 0.08086968, 0.        ],\n",
       "       [0.4125    , 0.1810585 , 0.18673699, 0.25255203, 0.        ],\n",
       "       [0.5125    , 0.2729805 , 0.259791  , 0.32997481, 1.        ],\n",
       "       [0.425     , 0.38718663, 0.30198262, 0.37451942, 1.        ],\n",
       "       [0.4875    , 0.49582173, 0.34895986, 0.41548456, 1.        ],\n",
       "       [0.4125    , 0.58774373, 0.45385292, 0.51624022, 1.        ],\n",
       "       [1.        , 0.81058496, 0.70182635, 0.84396129, 1.        ],\n",
       "       [0.225     , 0.86072423, 0.73796269, 0.89301339, 1.        ],\n",
       "       [0.175     , 0.89972145, 0.81521633, 0.9945645 , 1.        ],\n",
       "       [0.175     , 0.93871866, 0.82976853, 1.        , 1.        ],\n",
       "       [0.1       , 0.96100279, 0.85037601, 0.88121437, 1.        ],\n",
       "       [0.075     , 0.97771588, 0.851841  , 0.87803261, 1.        ],\n",
       "       [0.0625    , 0.99164345, 0.93055962, 0.84369614, 1.        ],\n",
       "       [0.0125    , 0.99442897, 0.99726536, 0.79398117, 1.        ],\n",
       "       [0.0125    , 0.99721448, 0.99726536, 0.79000398, 1.        ],\n",
       "       [0.        , 0.99721448, 0.99785135, 0.7373724 , 1.        ],\n",
       "       [0.0125    , 1.        , 1.        , 0.68527111, 1.        ]])"
      ]
     },
     "execution_count": 433,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_for_training_scaled"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 434,
   "id": "03b668b1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(19, 5)"
      ]
     },
     "execution_count": 434,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_for_training_scaled.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 435,
   "id": "88390259",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(19, 5)"
      ]
     },
     "execution_count": 435,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_for_testing_scaled.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 436,
   "id": "b6a58026",
   "metadata": {},
   "outputs": [],
   "source": [
    "kk=3\n",
    "def createXY(dataset,n_past):\n",
    "    dataX = []\n",
    "    dataY = []\n",
    "    for i in range(n_past, len(dataset)):\n",
    "            dataX.append(dataset[i - n_past:i, 0:dataset.shape[1]])\n",
    "            dataY.append(dataset[i,0])\n",
    "    return np.array(dataX),np.array(dataY)        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 437,
   "id": "18b62d65",
   "metadata": {},
   "outputs": [],
   "source": [
    "trainX,trainY=createXY(df_for_training_scaled,kk)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 438,
   "id": "8d694c12",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(16, 3, 5)"
      ]
     },
     "execution_count": 438,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trainX.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 439,
   "id": "184bfdb6",
   "metadata": {},
   "outputs": [],
   "source": [
    "testX,testY=createXY(df_for_testing_scaled,kk)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 440,
   "id": "5e77d396",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.0375    , 0.        , 0.        , 0.        , 0.        ],\n",
       "       [0.2625    , 0.06128134, 0.02383045, 0.0322153 , 0.        ],\n",
       "       [0.125     , 0.08913649, 0.06025979, 0.08086968, 0.        ]])"
      ]
     },
     "execution_count": 440,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trainX[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 441,
   "id": "bdaf6a49",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "trainX Shape--  (16, 3, 5)\n",
      "trainY Shape--  (16,)\n"
     ]
    }
   ],
   "source": [
    "print(\"trainX Shape-- \",trainX.shape)\n",
    "print(\"trainY Shape-- \",trainY.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 442,
   "id": "0c78e7db",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "testX Shape--  (16, 3, 5)\n",
      "testY Shape--  (16,)\n"
     ]
    }
   ],
   "source": [
    "print(\"testX Shape-- \",testX.shape)\n",
    "print(\"testY Shape-- \",testY.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 443,
   "id": "cbf9d2df",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "trainX[0]-- \n",
      " [[0.0375     0.         0.         0.         0.        ]\n",
      " [0.2625     0.06128134 0.02383045 0.0322153  0.        ]\n",
      " [0.125      0.08913649 0.06025979 0.08086968 0.        ]]\n",
      "\n",
      "trainY[0]--  0.41250000000000003\n"
     ]
    }
   ],
   "source": [
    "print(\"trainX[0]-- \\n\",trainX[0])\n",
    "print(\"\\ntrainY[0]-- \",trainY[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 444,
   "id": "a5892e85",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.41250000000000003"
      ]
     },
     "execution_count": 444,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trainY[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 445,
   "id": "713712db",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(16,)"
      ]
     },
     "execution_count": 445,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trainY.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 446,
   "id": "d165e52b",
   "metadata": {},
   "outputs": [],
   "source": [
    "from keras.wrappers.scikit_learn import KerasRegressor\n",
    "from sklearn.model_selection import GridSearchCV"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 447,
   "id": "42ffe2bf",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\HP\\AppData\\Local\\Temp\\ipykernel_23072\\1818068957.py:11: DeprecationWarning: KerasRegressor is deprecated, use Sci-Keras (https://github.com/adriangb/scikeras) instead. See https://www.adriangb.com/scikeras/stable/migration.html for help migrating.\n",
      "  grid_model = KerasRegressor(build_fn=build_model,verbose=1,validation_data=(testX,testY))\n"
     ]
    }
   ],
   "source": [
    "def build_model(optimizer):\n",
    "    grid_model = Sequential()\n",
    "    grid_model.add(LSTM(50,return_sequences=True,input_shape=(kk,5)))\n",
    "    grid_model.add(LSTM(50))\n",
    "    grid_model.add(Dropout(0.005))\n",
    "    grid_model.add(Dense(1))\n",
    "\n",
    "    grid_model.compile(loss = 'mse',optimizer = optimizer)\n",
    "    return grid_model\n",
    "\n",
    "grid_model = KerasRegressor(build_fn=build_model,verbose=1,validation_data=(testX,testY))\n",
    "# grid_model = Sci-Keras(build_fn=build_model,verbose=1,validation_data=(testX,testY))\n",
    "parameters = {'batch_size' : [15,20],\n",
    "              'epochs' : [8,10],\n",
    "              'optimizer' : ['adam','Adadelta'] }\n",
    "\n",
    "grid_search  = GridSearchCV(estimator = grid_model,\n",
    "                            param_grid = parameters,\n",
    "                            cv = 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 448,
   "id": "1fc54625",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 1/8\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.0138 - val_loss: 0.1339\n",
      "Epoch 2/8\n",
      "1/1 [==============================] - 0s 49ms/step - loss: 0.0078 - val_loss: 0.1239\n",
      "Epoch 3/8\n",
      "1/1 [==============================] - 0s 56ms/step - loss: 0.0046 - val_loss: 0.1159\n",
      "Epoch 4/8\n",
      "1/1 [==============================] - 0s 62ms/step - loss: 0.0032 - val_loss: 0.1098\n",
      "Epoch 5/8\n",
      "1/1 [==============================] - 0s 54ms/step - loss: 0.0033 - val_loss: 0.1058\n",
      "Epoch 6/8\n",
      "1/1 [==============================] - 0s 57ms/step - loss: 0.0043 - val_loss: 0.1036\n",
      "Epoch 7/8\n",
      "1/1 [==============================] - 0s 57ms/step - loss: 0.0050 - val_loss: 0.1026\n",
      "Epoch 8/8\n",
      "1/1 [==============================] - 0s 57ms/step - loss: 0.0052 - val_loss: 0.1027\n",
      "1/1 [==============================] - 0s 32ms/step - loss: 0.2006\n",
      "Epoch 1/8\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.2406 - val_loss: 0.1164\n",
      "Epoch 2/8\n",
      "1/1 [==============================] - 0s 49ms/step - loss: 0.2244 - val_loss: 0.1113\n",
      "Epoch 3/8\n",
      "1/1 [==============================] - 0s 54ms/step - loss: 0.2082 - val_loss: 0.1077\n",
      "Epoch 4/8\n",
      "1/1 [==============================] - 0s 51ms/step - loss: 0.1941 - val_loss: 0.1056\n",
      "Epoch 5/8\n",
      "1/1 [==============================] - 0s 54ms/step - loss: 0.1803 - val_loss: 0.1052\n",
      "Epoch 6/8\n",
      "1/1 [==============================] - 0s 44ms/step - loss: 0.1672 - val_loss: 0.1067\n",
      "Epoch 7/8\n",
      "1/1 [==============================] - 0s 54ms/step - loss: 0.1547 - val_loss: 0.1104\n",
      "Epoch 8/8\n",
      "1/1 [==============================] - 0s 45ms/step - loss: 0.1431 - val_loss: 0.1164\n",
      "1/1 [==============================] - 0s 25ms/step - loss: 0.0998\n",
      "Epoch 1/8\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.0033 - val_loss: 0.1196\n",
      "Epoch 2/8\n",
      "1/1 [==============================] - 0s 51ms/step - loss: 0.0035 - val_loss: 0.1196\n",
      "Epoch 3/8\n",
      "1/1 [==============================] - 0s 52ms/step - loss: 0.0033 - val_loss: 0.1196\n",
      "Epoch 4/8\n",
      "1/1 [==============================] - 0s 53ms/step - loss: 0.0033 - val_loss: 0.1196\n",
      "Epoch 5/8\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.0033 - val_loss: 0.1196\n",
      "Epoch 6/8\n",
      "1/1 [==============================] - 0s 51ms/step - loss: 0.0036 - val_loss: 0.1196\n",
      "Epoch 7/8\n",
      "1/1 [==============================] - 0s 52ms/step - loss: 0.0033 - val_loss: 0.1196\n",
      "Epoch 8/8\n",
      "1/1 [==============================] - 0s 48ms/step - loss: 0.0033 - val_loss: 0.1196\n",
      "1/1 [==============================] - 0s 24ms/step - loss: 0.2359\n",
      "Epoch 1/8\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.3051 - val_loss: 0.1626\n",
      "Epoch 2/8\n",
      "1/1 [==============================] - 0s 55ms/step - loss: 0.3063 - val_loss: 0.1626\n",
      "Epoch 3/8\n",
      "1/1 [==============================] - 0s 53ms/step - loss: 0.3048 - val_loss: 0.1626\n",
      "Epoch 4/8\n",
      "1/1 [==============================] - 0s 55ms/step - loss: 0.3058 - val_loss: 0.1625\n",
      "Epoch 5/8\n",
      "1/1 [==============================] - 0s 53ms/step - loss: 0.3052 - val_loss: 0.1625\n",
      "Epoch 6/8\n",
      "1/1 [==============================] - 0s 50ms/step - loss: 0.3056 - val_loss: 0.1625\n",
      "Epoch 7/8\n",
      "1/1 [==============================] - 0s 55ms/step - loss: 0.3060 - val_loss: 0.1625\n",
      "Epoch 8/8\n",
      "1/1 [==============================] - 0s 55ms/step - loss: 0.3054 - val_loss: 0.1625\n",
      "1/1 [==============================] - 0s 29ms/step - loss: 0.0194\n",
      "Epoch 1/10\n",
      "1/1 [==============================] - 2s 2s/step - loss: 0.0038 - val_loss: 0.1186\n",
      "Epoch 2/10\n",
      "1/1 [==============================] - 0s 49ms/step - loss: 0.0029 - val_loss: 0.1136\n",
      "Epoch 3/10\n",
      "1/1 [==============================] - 0s 48ms/step - loss: 0.0030 - val_loss: 0.1118\n",
      "Epoch 4/10\n",
      "1/1 [==============================] - 0s 49ms/step - loss: 0.0030 - val_loss: 0.1120\n",
      "Epoch 5/10\n",
      "1/1 [==============================] - 0s 49ms/step - loss: 0.0028 - val_loss: 0.1132\n",
      "Epoch 6/10\n",
      "1/1 [==============================] - 0s 50ms/step - loss: 0.0025 - val_loss: 0.1146\n",
      "Epoch 7/10\n",
      "1/1 [==============================] - 0s 58ms/step - loss: 0.0023 - val_loss: 0.1153\n",
      "Epoch 8/10\n",
      "1/1 [==============================] - 0s 54ms/step - loss: 0.0024 - val_loss: 0.1148\n",
      "Epoch 9/10\n",
      "1/1 [==============================] - 0s 52ms/step - loss: 0.0023 - val_loss: 0.1132\n",
      "Epoch 10/10\n",
      "1/1 [==============================] - 0s 56ms/step - loss: 0.0021 - val_loss: 0.1109\n",
      "1/1 [==============================] - 0s 21ms/step - loss: 0.2199\n",
      "Epoch 1/10\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.2373 - val_loss: 0.1132\n",
      "Epoch 2/10\n",
      "1/1 [==============================] - 0s 50ms/step - loss: 0.2208 - val_loss: 0.1074\n",
      "Epoch 3/10\n",
      "1/1 [==============================] - 0s 47ms/step - loss: 0.2037 - val_loss: 0.1033\n",
      "Epoch 4/10\n",
      "1/1 [==============================] - 0s 42ms/step - loss: 0.1884 - val_loss: 0.1011\n",
      "Epoch 5/10\n",
      "1/1 [==============================] - 0s 41ms/step - loss: 0.1740 - val_loss: 0.1009\n",
      "Epoch 6/10\n",
      "1/1 [==============================] - 0s 50ms/step - loss: 0.1609 - val_loss: 0.1030\n",
      "Epoch 7/10\n",
      "1/1 [==============================] - 0s 42ms/step - loss: 0.1475 - val_loss: 0.1075\n",
      "Epoch 8/10\n",
      "1/1 [==============================] - 0s 50ms/step - loss: 0.1355 - val_loss: 0.1149\n",
      "Epoch 9/10\n",
      "1/1 [==============================] - 0s 48ms/step - loss: 0.1274 - val_loss: 0.1253\n",
      "Epoch 10/10\n",
      "1/1 [==============================] - 0s 70ms/step - loss: 0.1164 - val_loss: 0.1390\n",
      "1/1 [==============================] - 0s 37ms/step - loss: 0.1686\n",
      "Epoch 1/10\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.0118 - val_loss: 0.1449\n",
      "Epoch 2/10\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.0125 - val_loss: 0.1448\n",
      "Epoch 3/10\n",
      "1/1 [==============================] - 0s 59ms/step - loss: 0.0124 - val_loss: 0.1448\n",
      "Epoch 4/10\n",
      "1/1 [==============================] - 0s 55ms/step - loss: 0.0118 - val_loss: 0.1448\n",
      "Epoch 5/10\n",
      "1/1 [==============================] - 0s 56ms/step - loss: 0.0120 - val_loss: 0.1448\n",
      "Epoch 6/10\n",
      "1/1 [==============================] - 0s 52ms/step - loss: 0.0115 - val_loss: 0.1448\n",
      "Epoch 7/10\n",
      "1/1 [==============================] - 0s 59ms/step - loss: 0.0123 - val_loss: 0.1448\n",
      "Epoch 8/10\n",
      "1/1 [==============================] - 0s 54ms/step - loss: 0.0122 - val_loss: 0.1448\n",
      "Epoch 9/10\n",
      "1/1 [==============================] - 0s 50ms/step - loss: 0.0122 - val_loss: 0.1447\n",
      "Epoch 10/10\n",
      "1/1 [==============================] - 0s 41ms/step - loss: 0.0118 - val_loss: 0.1447\n",
      "1/1 [==============================] - 0s 22ms/step - loss: 0.2773\n",
      "Epoch 1/10\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.2484 - val_loss: 0.1260\n",
      "Epoch 2/10\n",
      "1/1 [==============================] - 0s 54ms/step - loss: 0.2483 - val_loss: 0.1260\n",
      "Epoch 3/10\n",
      "1/1 [==============================] - 0s 56ms/step - loss: 0.2483 - val_loss: 0.1260\n",
      "Epoch 4/10\n",
      "1/1 [==============================] - 0s 43ms/step - loss: 0.2485 - val_loss: 0.1260\n",
      "Epoch 5/10\n",
      "1/1 [==============================] - 0s 40ms/step - loss: 0.2483 - val_loss: 0.1260\n",
      "Epoch 6/10\n",
      "1/1 [==============================] - 0s 49ms/step - loss: 0.2482 - val_loss: 0.1260\n",
      "Epoch 7/10\n",
      "1/1 [==============================] - 0s 50ms/step - loss: 0.2482 - val_loss: 0.1260\n",
      "Epoch 8/10\n",
      "1/1 [==============================] - 0s 50ms/step - loss: 0.2480 - val_loss: 0.1259\n",
      "Epoch 9/10\n",
      "1/1 [==============================] - 0s 44ms/step - loss: 0.2477 - val_loss: 0.1259\n",
      "Epoch 10/10\n",
      "1/1 [==============================] - 0s 47ms/step - loss: 0.2482 - val_loss: 0.1259\n",
      "1/1 [==============================] - 0s 21ms/step - loss: 0.0036\n",
      "Epoch 1/8\n",
      "1/1 [==============================] - 4s 4s/step - loss: 0.0077 - val_loss: 0.1300\n",
      "Epoch 2/8\n",
      "1/1 [==============================] - 0s 55ms/step - loss: 0.0043 - val_loss: 0.1215\n",
      "Epoch 3/8\n",
      "1/1 [==============================] - 0s 49ms/step - loss: 0.0032 - val_loss: 0.1157\n",
      "Epoch 4/8\n",
      "1/1 [==============================] - 0s 53ms/step - loss: 0.0037 - val_loss: 0.1126\n",
      "Epoch 5/8\n",
      "1/1 [==============================] - 0s 49ms/step - loss: 0.0041 - val_loss: 0.1115\n",
      "Epoch 6/8\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.0042 - val_loss: 0.1118\n",
      "Epoch 7/8\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.0039 - val_loss: 0.1130\n",
      "Epoch 8/8\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.0032 - val_loss: 0.1147\n",
      "1/1 [==============================] - 0s 24ms/step - loss: 0.2266\n",
      "Epoch 1/8\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.2476 - val_loss: 0.1174\n",
      "Epoch 2/8\n",
      "1/1 [==============================] - 0s 43ms/step - loss: 0.2316 - val_loss: 0.1100\n",
      "Epoch 3/8\n",
      "1/1 [==============================] - 0s 41ms/step - loss: 0.2150 - val_loss: 0.1038\n",
      "Epoch 4/8\n",
      "1/1 [==============================] - 0s 42ms/step - loss: 0.1998 - val_loss: 0.0987\n",
      "Epoch 5/8\n",
      "1/1 [==============================] - 0s 40ms/step - loss: 0.1851 - val_loss: 0.0950\n",
      "Epoch 6/8\n",
      "1/1 [==============================] - 0s 43ms/step - loss: 0.1711 - val_loss: 0.0926\n",
      "Epoch 7/8\n",
      "1/1 [==============================] - 0s 44ms/step - loss: 0.1577 - val_loss: 0.0920\n",
      "Epoch 8/8\n",
      "1/1 [==============================] - 0s 47ms/step - loss: 0.1452 - val_loss: 0.0933\n",
      "1/1 [==============================] - 0s 22ms/step - loss: 0.0530\n",
      "Epoch 1/8\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.0118 - val_loss: 0.1461\n",
      "Epoch 2/8\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.0119 - val_loss: 0.1460\n",
      "Epoch 3/8\n",
      "1/1 [==============================] - 0s 49ms/step - loss: 0.0120 - val_loss: 0.1460\n",
      "Epoch 4/8\n",
      "1/1 [==============================] - 0s 47ms/step - loss: 0.0119 - val_loss: 0.1460\n",
      "Epoch 5/8\n",
      "1/1 [==============================] - 0s 41ms/step - loss: 0.0119 - val_loss: 0.1460\n",
      "Epoch 6/8\n",
      "1/1 [==============================] - 0s 45ms/step - loss: 0.0118 - val_loss: 0.1460\n",
      "Epoch 7/8\n",
      "1/1 [==============================] - 0s 48ms/step - loss: 0.0118 - val_loss: 0.1460\n",
      "Epoch 8/8\n",
      "1/1 [==============================] - 0s 45ms/step - loss: 0.0116 - val_loss: 0.1460\n",
      "1/1 [==============================] - 0s 30ms/step - loss: 0.2801\n",
      "Epoch 1/8\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.2697 - val_loss: 0.1391\n",
      "Epoch 2/8\n",
      "1/1 [==============================] - 0s 40ms/step - loss: 0.2695 - val_loss: 0.1390\n",
      "Epoch 3/8\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.2686 - val_loss: 0.1390\n",
      "Epoch 4/8\n",
      "1/1 [==============================] - 0s 40ms/step - loss: 0.2691 - val_loss: 0.1390\n",
      "Epoch 5/8\n",
      "1/1 [==============================] - 0s 41ms/step - loss: 0.2692 - val_loss: 0.1390\n",
      "Epoch 6/8\n",
      "1/1 [==============================] - 0s 34ms/step - loss: 0.2691 - val_loss: 0.1390\n",
      "Epoch 7/8\n",
      "1/1 [==============================] - 0s 50ms/step - loss: 0.2692 - val_loss: 0.1390\n",
      "Epoch 8/8\n",
      "1/1 [==============================] - 0s 41ms/step - loss: 0.2690 - val_loss: 0.1390\n",
      "1/1 [==============================] - 0s 21ms/step - loss: 0.0088\n",
      "Epoch 1/10\n",
      "1/1 [==============================] - 2s 2s/step - loss: 0.0044 - val_loss: 0.1233\n",
      "Epoch 2/10\n",
      "1/1 [==============================] - 0s 41ms/step - loss: 0.0037 - val_loss: 0.1193\n",
      "Epoch 3/10\n",
      "1/1 [==============================] - 0s 48ms/step - loss: 0.0039 - val_loss: 0.1188\n",
      "Epoch 4/10\n",
      "1/1 [==============================] - 0s 40ms/step - loss: 0.0037 - val_loss: 0.1201\n",
      "Epoch 5/10\n",
      "1/1 [==============================] - 0s 45ms/step - loss: 0.0034 - val_loss: 0.1219\n",
      "Epoch 6/10\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.0031 - val_loss: 0.1230\n",
      "Epoch 7/10\n",
      "1/1 [==============================] - 0s 36ms/step - loss: 0.0031 - val_loss: 0.1226\n",
      "Epoch 8/10\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.0032 - val_loss: 0.1208\n",
      "Epoch 9/10\n",
      "1/1 [==============================] - 0s 41ms/step - loss: 0.0029 - val_loss: 0.1182\n",
      "Epoch 10/10\n",
      "1/1 [==============================] - 0s 37ms/step - loss: 0.0025 - val_loss: 0.1154\n",
      "1/1 [==============================] - 0s 26ms/step - loss: 0.2282\n",
      "Epoch 1/10\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.2586 - val_loss: 0.1224\n",
      "Epoch 2/10\n",
      "1/1 [==============================] - 0s 43ms/step - loss: 0.2395 - val_loss: 0.1125\n",
      "Epoch 3/10\n",
      "1/1 [==============================] - 0s 50ms/step - loss: 0.2214 - val_loss: 0.1043\n",
      "Epoch 4/10\n",
      "1/1 [==============================] - 0s 57ms/step - loss: 0.2050 - val_loss: 0.0977\n",
      "Epoch 5/10\n",
      "1/1 [==============================] - 0s 45ms/step - loss: 0.1942 - val_loss: 0.0929\n",
      "Epoch 6/10\n",
      "1/1 [==============================] - 0s 52ms/step - loss: 0.1738 - val_loss: 0.0898\n",
      "Epoch 7/10\n",
      "1/1 [==============================] - 0s 53ms/step - loss: 0.1615 - val_loss: 0.0888\n",
      "Epoch 8/10\n",
      "1/1 [==============================] - 0s 48ms/step - loss: 0.1462 - val_loss: 0.0901\n",
      "Epoch 9/10\n",
      "1/1 [==============================] - 0s 52ms/step - loss: 0.1339 - val_loss: 0.0939\n",
      "Epoch 10/10\n",
      "1/1 [==============================] - 0s 55ms/step - loss: 0.1230 - val_loss: 0.1006\n",
      "1/1 [==============================] - 0s 31ms/step - loss: 0.0877\n",
      "Epoch 1/10\n",
      "1/1 [==============================] - 4s 4s/step - loss: 0.0152 - val_loss: 0.1554\n",
      "Epoch 2/10\n",
      "1/1 [==============================] - 0s 54ms/step - loss: 0.0164 - val_loss: 0.1554\n",
      "Epoch 3/10\n",
      "1/1 [==============================] - 0s 47ms/step - loss: 0.0161 - val_loss: 0.1554\n",
      "Epoch 4/10\n",
      "1/1 [==============================] - 0s 51ms/step - loss: 0.0161 - val_loss: 0.1553\n",
      "Epoch 5/10\n",
      "1/1 [==============================] - 0s 56ms/step - loss: 0.0160 - val_loss: 0.1553\n",
      "Epoch 6/10\n",
      "1/1 [==============================] - 0s 52ms/step - loss: 0.0160 - val_loss: 0.1553\n",
      "Epoch 7/10\n",
      "1/1 [==============================] - 0s 41ms/step - loss: 0.0158 - val_loss: 0.1553\n",
      "Epoch 8/10\n",
      "1/1 [==============================] - 0s 51ms/step - loss: 0.0157 - val_loss: 0.1553\n",
      "Epoch 9/10\n",
      "1/1 [==============================] - 0s 45ms/step - loss: 0.0159 - val_loss: 0.1552\n",
      "Epoch 10/10\n",
      "1/1 [==============================] - 0s 52ms/step - loss: 0.0161 - val_loss: 0.1552\n",
      "1/1 [==============================] - 0s 24ms/step - loss: 0.2944\n",
      "Epoch 1/10\n",
      "1/1 [==============================] - 3s 3s/step - loss: 0.2693 - val_loss: 0.1401\n",
      "Epoch 2/10\n",
      "1/1 [==============================] - 0s 44ms/step - loss: 0.2701 - val_loss: 0.1401\n",
      "Epoch 3/10\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.2705 - val_loss: 0.1401\n",
      "Epoch 4/10\n",
      "1/1 [==============================] - 0s 52ms/step - loss: 0.2706 - val_loss: 0.1401\n",
      "Epoch 5/10\n",
      "1/1 [==============================] - 0s 54ms/step - loss: 0.2699 - val_loss: 0.1401\n",
      "Epoch 6/10\n",
      "1/1 [==============================] - 0s 53ms/step - loss: 0.2700 - val_loss: 0.1400\n",
      "Epoch 7/10\n",
      "1/1 [==============================] - 0s 52ms/step - loss: 0.2700 - val_loss: 0.1400\n",
      "Epoch 8/10\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.2700 - val_loss: 0.1400\n",
      "Epoch 9/10\n",
      "1/1 [==============================] - 0s 49ms/step - loss: 0.2700 - val_loss: 0.1400\n",
      "Epoch 10/10\n",
      "1/1 [==============================] - 0s 46ms/step - loss: 0.2700 - val_loss: 0.1400\n",
      "1/1 [==============================] - 0s 27ms/step - loss: 0.0101\n",
      "Epoch 1/8\n",
      "2/2 [==============================] - 3s 625ms/step - loss: 0.1378 - val_loss: 0.1383\n",
      "Epoch 2/8\n",
      "2/2 [==============================] - 0s 50ms/step - loss: 0.1383 - val_loss: 0.1383\n",
      "Epoch 3/8\n",
      "2/2 [==============================] - 0s 37ms/step - loss: 0.1375 - val_loss: 0.1383\n",
      "Epoch 4/8\n",
      "2/2 [==============================] - 0s 46ms/step - loss: 0.1375 - val_loss: 0.1383\n",
      "Epoch 5/8\n",
      "2/2 [==============================] - 0s 42ms/step - loss: 0.1382 - val_loss: 0.1383\n",
      "Epoch 6/8\n",
      "2/2 [==============================] - 0s 37ms/step - loss: 0.1379 - val_loss: 0.1383\n",
      "Epoch 7/8\n",
      "2/2 [==============================] - 0s 52ms/step - loss: 0.1383 - val_loss: 0.1382\n",
      "Epoch 8/8\n",
      "2/2 [==============================] - 0s 49ms/step - loss: 0.1385 - val_loss: 0.1382\n"
     ]
    }
   ],
   "source": [
    "grid_search = grid_search.fit(trainX,trainY)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 449,
   "id": "a9e26e10",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'batch_size': 15, 'epochs': 8, 'optimizer': 'Adadelta'}"
      ]
     },
     "execution_count": 449,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grid_search.best_params_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 450,
   "id": "d6851ffc",
   "metadata": {},
   "outputs": [],
   "source": [
    "my_model=grid_search.best_estimator_.model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 451,
   "id": "9f0b2e50",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<keras.engine.sequential.Sequential at 0x2563fdefa90>"
      ]
     },
     "execution_count": 451,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 452,
   "id": "eeb97d64",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1/1 [==============================] - 0s 497ms/step\n"
     ]
    }
   ],
   "source": [
    "prediction=my_model.predict(testX)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 453,
   "id": "8699c0d3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "prediction\n",
      " [[-0.00212429]\n",
      " [-0.00371657]\n",
      " [-0.00377162]\n",
      " [-0.00594182]\n",
      " [-0.00810853]\n",
      " [-0.0090081 ]\n",
      " [-0.00944263]\n",
      " [-0.0114226 ]\n",
      " [-0.01281806]\n",
      " [-0.01035406]\n",
      " [-0.01023421]\n",
      " [-0.00998384]\n",
      " [-0.00886988]\n",
      " [-0.00792074]\n",
      " [-0.0065188 ]\n",
      " [-0.00548704]]\n",
      "\n",
      "Prediction Shape- (16, 1)\n"
     ]
    }
   ],
   "source": [
    "print(\"prediction\\n\", prediction)\n",
    "print(\"\\nPrediction Shape-\",prediction.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 454,
   "id": "2be6090a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(16, 1)"
      ]
     },
     "execution_count": 454,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prediction.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 455,
   "id": "c8c654a6",
   "metadata": {},
   "outputs": [],
   "source": [
    "# scaler.inverse_transform(prediction)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 456,
   "id": "44862c61",
   "metadata": {},
   "outputs": [],
   "source": [
    "prediction_copies_array = np.repeat(prediction,5, axis=-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 457,
   "id": "1dbd500f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(16, 5)"
      ]
     },
     "execution_count": 457,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prediction_copies_array.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 458,
   "id": "3b00bd6e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.00212429, -0.00212429, -0.00212429, -0.00212429, -0.00212429],\n",
       "       [-0.00371657, -0.00371657, -0.00371657, -0.00371657, -0.00371657],\n",
       "       [-0.00377162, -0.00377162, -0.00377162, -0.00377162, -0.00377162],\n",
       "       [-0.00594182, -0.00594182, -0.00594182, -0.00594182, -0.00594182],\n",
       "       [-0.00810853, -0.00810853, -0.00810853, -0.00810853, -0.00810853],\n",
       "       [-0.0090081 , -0.0090081 , -0.0090081 , -0.0090081 , -0.0090081 ],\n",
       "       [-0.00944263, -0.00944263, -0.00944263, -0.00944263, -0.00944263],\n",
       "       [-0.0114226 , -0.0114226 , -0.0114226 , -0.0114226 , -0.0114226 ],\n",
       "       [-0.01281806, -0.01281806, -0.01281806, -0.01281806, -0.01281806],\n",
       "       [-0.01035406, -0.01035406, -0.01035406, -0.01035406, -0.01035406],\n",
       "       [-0.01023421, -0.01023421, -0.01023421, -0.01023421, -0.01023421],\n",
       "       [-0.00998384, -0.00998384, -0.00998384, -0.00998384, -0.00998384],\n",
       "       [-0.00886988, -0.00886988, -0.00886988, -0.00886988, -0.00886988],\n",
       "       [-0.00792074, -0.00792074, -0.00792074, -0.00792074, -0.00792074],\n",
       "       [-0.0065188 , -0.0065188 , -0.0065188 , -0.0065188 , -0.0065188 ],\n",
       "       [-0.00548704, -0.00548704, -0.00548704, -0.00548704, -0.00548704]],\n",
       "      dtype=float32)"
      ]
     },
     "execution_count": 458,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prediction_copies_array"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 459,
   "id": "84f2780a",
   "metadata": {},
   "outputs": [],
   "source": [
    "pred=scaler.inverse_transform(np.reshape(prediction_copies_array,(len(prediction),5)))[:,0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 460,
   "id": "2c86afce",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.16994298, -0.2973256 , -0.30172935, -0.47534567, -0.64868224,\n",
       "       -0.72064805, -0.7554103 , -0.91380805, -1.0254445 , -0.82832456,\n",
       "       -0.81873655, -0.7987071 , -0.7095902 , -0.6336595 , -0.5215038 ,\n",
       "       -0.43896285], dtype=float32)"
      ]
     },
     "execution_count": 460,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pred"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 461,
   "id": "4ec05dff",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(80,)"
      ]
     },
     "execution_count": 461,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "original_copies_array = np.repeat(testY,5, axis=-1)\n",
    "\n",
    "original_copies_array.shape\n",
    "\n",
    "original=scaler.inverse_transform(np.reshape(original_copies_array,(len(testY),5)))[:,0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 462,
   "id": "442e0222",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.16994298, -0.2973256 , -0.30172935, -0.47534567, -0.64868224,\n",
       "       -0.72064805, -0.7554103 , -0.91380805, -1.0254445 , -0.82832456,\n",
       "       -0.81873655, -0.7987071 , -0.7095902 , -0.6336595 , -0.5215038 ,\n",
       "       -0.43896285], dtype=float32)"
      ]
     },
     "execution_count": 462,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pred"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 463,
   "id": "cecfd7bf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Pred Values--  [-0.16994298 -0.2973256  -0.30172935 -0.47534567 -0.64868224 -0.72064805\n",
      " -0.7554103  -0.91380805 -1.0254445  -0.82832456 -0.81873655 -0.7987071\n",
      " -0.7095902  -0.6336595  -0.5215038  -0.43896285]\n",
      "\n",
      "Original Values--  [33. 41. 34. 39. 33. 80. 18. 14. 14.  8.  6.  5.  1.  1.  0.  1.]\n"
     ]
    }
   ],
   "source": [
    "print(\"Pred Values-- \" ,pred)\n",
    "print(\"\\nOriginal Values-- \",original)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b1986d23",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 464,
   "id": "07e37414",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 465,
   "id": "bfa9b94b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x25643c92910>]"
      ]
     },
     "execution_count": 465,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x25643c92cd0>]"
      ]
     },
     "execution_count": 465,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "Text(0.5, 1.0, ' New Prediction')"
      ]
     },
     "execution_count": 465,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "Text(0.5, 0, 'Time')"
      ]
     },
     "execution_count": 465,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'Number')"
      ]
     },
     "execution_count": 465,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x25643c92e20>"
      ]
     },
     "execution_count": 465,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEWCAYAAABhffzLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAvWElEQVR4nO3deXxU1f3/8deHTVZFMCISICRSlE3QuAMqKNDFtbUurV/4CmJr7aZdrK3V9td+v9XWutWqFLW0WlulWm1dKlIVv+64JSAqqKBBhIjIpixJPr8/zgwMYUKGZO7cSeb9fDzuY+7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xkZvvEGlUarTnxvwAMNLMBZtaB8EDt/phj2srMjFA3vdDdfxt3POm4+4/cvdjdSwi/v/+4e96UVt39A+A9MxuUWDQOeC3GkNJ5FzjczDon/s3HkWcPoFPcD0xKzE8C7osxlh2Y2URCteOJ7v5J3PHU5+6V7r63u5ck/maqgIMS/0/zSqtN/ImHQBcA/yb8od3l7gvijWo7RwFnE0rRrySmz8UdVAv0TeAOM6sARgD/E28420vcjcwCXgIqCX9zsb/Wb2Z3As8Ag8ysysymAL8CjjezRYQ7lV/lWXy/A7oBsxN/LzfFFd9OYmwR1GWDiEiBabUlfhERSU+JX0SkwCjxi4gUGCV+EZECo8QvIlJglPhFUphZz5TmtR+Y2bLE/Hoz+33c8Ylkg5pzijTAzC4H1rv7b+KORSSbVOIXyYCZHZMcj8DMLjezmWb2pJktNbNTzexKM6s0s4cTXXFgZgeb2RNm9qKZ/TvZHYJI3JT4RZqmDBgLnAjcDjzm7sOAT4HPJ5L/9cCX3P1g4Fbgl3EFK5KqXdwBiLRQD7n7FjOrJAyu8nBieSVQAgwChhK6FyCxzfI0xxHJOSV+kabZBODudWa2JaWnyDrC35UBC9w974aCFFFVj0g03gCKkmMAm1l7MxsSc0wigBK/SCQSw31+CbjCzF4FXiF/++GXAqPmnCIiBUYlfhGRAqPELyJSYJT4RUQKjBK/iEiBUeIXESkwSvwiIgVGiV9EpMD8fwh2ORQze/uOAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(original, color = 'red', label = 'Real')\n",
    "plt.plot(pred, color = 'blue', label = 'Predicted')\n",
    "plt.title(' New Prediction')\n",
    "plt.xlabel('Time')\n",
    "plt.ylabel('Number')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
